package cn.huhaoran.yaoyaolingxian.actions;

import cn.huhaoran.yaoyaolingxian.ui.ExportImportBranchByAFileDialog;
import cn.huhaoran.yaoyaolingxian.ui.GenerateCode;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.vfs.VirtualFile;

import java.util.Objects;

/**
 * 将分支【导出/导入】至文件
 * @author huhaoran
 * @description:
 * @date 2024/8/9
 */
public class ExportImportBranchByAFile extends AnAction {

    @Override
    public void actionPerformed(AnActionEvent e) {
        // TODO: insert action logic here
        String projectBasePath = Objects.requireNonNull(e.getProject()).getBasePath();
        System.out.println("项目路径 = " + projectBasePath);
        //VirtualFile file = e.getData(CommonDataKeys.VIRTUAL_FILE);
        // 弹出对话框
        ExportImportBranchByAFileDialog exportImportBranchByAFileDialog = new ExportImportBranchByAFileDialog();
        exportImportBranchByAFileDialog.pack();
        exportImportBranchByAFileDialog.setVisible(true);
    }
}
